package org.jash.report.entity

import java.text.SimpleDateFormat
import java.util.Date

private val day = SimpleDateFormat("yyyy年MM月dd日")
private val week = SimpleDateFormat("yyyy年MM月w周")
private val month = SimpleDateFormat("yyyy年MM月")
private val m = SimpleDateFormat("M")
data class ReportEntity(
    val reportId: Int,
    val reportNextTitle: String,
    var reportNextValue: String,
    val reportNowTitle: String,
    var reportNowValue: String,
    val reportRemind: String,
    val reportTime: Long,
    val reportType: Int
) {
    fun getPublishDate():String = day.format(Date(reportTime * 1000))
    fun getTitle():String = "${when(reportType){
        1 -> day
        2 -> week
        else -> month
    }.format(Date(reportTime * 1000))}, ${when(reportType){
        1 -> "日报"
        2 -> "周报"
        else -> "月报"
    }}"
    fun getMonth():String = m.format(Date(reportTime * 1000))
}